package cn.kdyzm;

import cn.hutool.core.util.HexUtil;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * @author kdyzm
 * @date 2023/12/7
 */
public class Application {

    public static void main(String[] args) {
        try {
            InetAddress inetAddress = InetAddress.getByName("192.168.3.255");
            int port = 9;
            StringBuilder data = new StringBuilder("FFFFFFFFFFFF");
            for (int i = 0; i < 16; i++) {
                // 网卡地址    
                data.append("58112208850B");
            }
            data.append("000000000000");
            byte[] bytes = HexUtil.decodeHex(data.toString());
            DatagramSocket datagramSocket = new DatagramSocket();
            DatagramPacket packet = new DatagramPacket(bytes, bytes.length, inetAddress, port);
            datagramSocket.send(packet);
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }

    }

}
